﻿using System;
using System.Collections.Generic;
using WeiboWPSdk.Json;

namespace WeiboWPSdk.ResponseEntity {
    /// <summary>
    /// 隐私
    /// </summary>
    public class Privacy : EntityBase {
        /// <summary>
        /// 是否可以评论我的微博，0：所有人、1：关注的人、2：可信用户
        /// </summary>
        [JsonProperty("comment")]
        public int Comment { get; internal set; }
        /// <summary>
        /// 是否开启地理信息，0：不开启、1：开启
        /// </summary>
        [JsonProperty("geo")]
        public bool GEO { get; internal set; }
        /// <summary>
        /// 是否可以给我发私信，0：所有人、1：我关注的人、2：可信用户
        /// </summary>
        [JsonProperty("message")]
        public int Message { get; internal set; }
        /// <summary>
        /// 是否可以通过真名搜索到我，0：不可以、1：可以
        /// </summary>
        [JsonProperty("realname")]
        public bool RealName { get; internal set; }
        /// <summary>
        /// 勋章是否可见，0：不可见、1：可见
        /// </summary>
        [JsonProperty("badge")]
        public bool Badge { get; internal set; }
        /// <summary>
        /// 是否可以通过手机号码搜索到我，0：不可以、1：可以
        /// </summary>
        [JsonProperty("mobile")]
        public bool Mobile { get; internal set; }
        /// <summary>
        /// 是否开启webim， 0：不开启、1：开启
        /// </summary>
        [JsonProperty("webim")]
        public bool WebIm { get; internal set; }
        [JsonProperty("profileUrlType")]
        public int ProfileUrlType { get; internal set; }
    }

    /// <summary>
    /// 学校
    /// </summary>
    public class School : EntityBase {
        [JsonProperty("id")]
        public long Id { get; internal set; }
        [JsonProperty("name")]
        public string Name { get; internal set; }
        [JsonProperty("type")]
        public int Type { get; internal set; }
        [JsonProperty("location")]
        public int Location { get; internal set; }
    }

    public class ApiRateLimit : EntityBase {
        [JsonProperty("api")]
        public string Api { get; internal set; }
        [JsonProperty("limit")]
        public int Limit { get; internal set; }
        [JsonProperty("limit_time_unit")]
        public string LimitTimeUnit { get; internal set; }
        [JsonProperty("remaining_hits")]
        public int RemainHits { get; internal set; }
    }

    /// <summary>
    /// 访问频率限制
    /// </summary>
    public class RateLimitStatus : EntityBase {
        [JsonProperty("api_rate_limits")]
        public IEnumerable<ApiRateLimit> ApiRateLimits { get; internal set; }
        [JsonProperty("ip_limit")]
        public int IpLimit { get; internal set; }
        [JsonProperty("limit_time_unit")]
        public string LimitTimeUnit { get; internal set; }
        [JsonProperty("remaining_ip_hits")]
        public int RemainIpHits { get; internal set; }
        [JsonProperty("remaining_user_hits")]
        public int RemainUserHits { get; internal set; }
        [JsonProperty("reset_time")]
        public DateTime ResetTime { get; internal set; }
        [JsonProperty("reset_time_in_seconds")]
        public int ResetTimeInSeconds { get; internal set; }
        [JsonProperty("user_limit")]
        public int UserLimit { get; internal set; }
    }
}
